<template>
	<view class="uiwu">
		<uiwu-list loading="noMore">
			<navigator hover-class="none" :url="`./articledetail?id=${item.id}`" class="uiwu-list-item" v-for="(item,index) in listData" :key="index">
				<view class="top uiwu-flex uiwu-flex-space">
					<text class="title">{{item.title}}</text>
					<text class="time">{{item.create_time}}</text>
				</view>
				<view class="doc uiwu-hidden4" v-html="item.intro"></view>
			</navigator>
		</uiwu-list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isLock:true,
				page:1,
				listData:[],
				more:'loading',
			};
		},
		onLoad() {
			this.getlistData()
		},
		onReachBottom() {
			if(this.isLock){
				this.isLock = false;
				this.page++
				this.more='loading'
				this.getlistData(true);
			}
		},
		methods:{
			async getlistData(mack){
				const { data:{list,count} , msg , code } = await this.uiwu.get({
					url:'gg/lists',
					data:{
						page_no:this.page
					}
				})
				if(!code) return this.uiwu.toast(msg)
				this.uiwu.morelist({
					mack:mack || false,//true为加载更多  fasle为刷新
					_this:this,//当前页面this指向
					list:list,
					total:count,
				})
				console.log(this.listData)//输出赋值之后的变量
				
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #F5F7F9;
	}
	.uiwu{
		padding: 0 30rpx;
	}
	.uiwu-list-item{
		background-color: #fff;
		margin-top: 24rpx;
		padding: 32rpx;
		border-radius: 20rpx;
		.top{
			.title{
				font-size: 30rpx;
				font-weight: 800;
				color: #1A1A1A;
			}
			.time{
				font-size: 24rpx;
				font-weight: 300;
				color: #999999;
			}
		}
		.doc{
			font-size: 28rpx;
			font-weight: 500;
			color: #444444;
			margin-top: 30rpx;
		}
	}
</style>
